package cn.funnyxb.powerremember.uis.wordbases.onlineImport;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import cn.funnyxb.powerremember.beans.WordBase;
import cn.funnyxb.tools.appFrame.App;
import cn.funnyxb.tools.appFrame.activityFrame.ActivitysHolder;
import cn.funnyxb.tools.appFrame.debugTool.Debuger;
import com.mobclick.android.MobclickAgent;
import java.util.ArrayList;

public class OnlineImportWordBaseActivity extends Activity
  implements IUI_OnlineImportWordBase
{
  private IProccessor_OnlineImportWordBase proccessor;
  private ProgressDialog progressDialog_ImportWordbase;
  ProgressDialog progressDialog_downList;

  private void dismissWaittingDialog()
  {
    if (this.progressDialog_downList == null)
      return;
    this.progressDialog_downList.dismiss();
  }

  private void initFrame()
  {
    setContentView(2130903060);
    ListView localListView = (ListView)findViewById(2131165365);
    localListView.setBackgroundResource(17301654);
    localListView.setOnItemClickListener(new 1(this));
  }

  private void log(String paramString)
  {
    Debuger.log("onlineimportActivity", paramString);
  }

  private void showWaittingDialog()
  {
    this.progressDialog_downList = new ProgressDialog(this);
    this.progressDialog_downList.setTitle(2131034131);
    this.progressDialog_downList.setMessage(getString(2131034206));
    this.progressDialog_downList.setCancelable(false);
    this.progressDialog_downList.setButton(getString(2131034136), new 2(this));
    this.progressDialog_downList.show();
  }

  private void showWordBaseDialog(WordBase paramWordBase)
  {
    new AlertDialog.Builder(this).setTitle(2131034197).setMessage(getString(2131034198) + ":" + paramWordBase.getName() + "\n" + getString(2131034137) + ":" + paramWordBase.getIntro() + "\n" + getString(2131034200) + ":" + paramWordBase.getWordsCnt() + "\n" + getString(2131034138) + ":" + paramWordBase.getFileSize() + "KB (" + (paramWordBase.getFileSize() / 1024) + " MB)").setPositiveButton(2131034139, new 3(this, paramWordBase)).setNegativeButton(2131034134, null).create().show();
  }

  private void updateListview(ArrayList<WordBase> paramArrayList)
  {
    ((ListView)findViewById(2131165365)).setAdapter(new ArrayAdapter(this, 17367043, 16908308, paramArrayList));
  }

  public void notifyCanceledImport()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if ((this.progressDialog_ImportWordbase != null) && (this.progressDialog_ImportWordbase.isShowing()))
        this.progressDialog_ImportWordbase.dismiss();
      this.progressDialog_ImportWordbase = null;
      Toast.makeText(this, 2131034145, 1).show();
    }
  }

  public void notifyCannotGetConnectSource()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if (this.progressDialog_ImportWordbase != null)
        this.progressDialog_ImportWordbase.dismiss();
      Toast.makeText(this, 2131034172, 1);
    }
  }

  public void notifyDeleteingTempfile()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if (this.progressDialog_ImportWordbase == null)
        continue;
      this.progressDialog_ImportWordbase.setMessage(getString(2131034210));
    }
  }

  public void notifyExceptionWhenConnect()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      log("a");
      if (this.progressDialog_ImportWordbase != null)
        this.progressDialog_ImportWordbase.dismiss();
      Toast.makeText(this, 2131034171, 1);
    }
  }

  public void notifyServerConnecting()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if (this.progressDialog_ImportWordbase == null)
        continue;
      this.progressDialog_ImportWordbase.setMessage(getString(2131034173));
    }
  }

  public void notifyStartImport()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if (this.progressDialog_ImportWordbase == null)
        this.progressDialog_ImportWordbase = new ProgressDialog(this);
      this.progressDialog_ImportWordbase.setTitle(2131034131);
      this.progressDialog_ImportWordbase.setMessage(getString(2131034142));
      this.progressDialog_ImportWordbase.setCancelable(false);
      this.progressDialog_ImportWordbase.setButton(getString(2131034136), new 4(this));
      this.progressDialog_ImportWordbase.show();
    }
  }

  public void notifyTasksDataLoaded(ArrayList<WordBase> paramArrayList, int paramInt)
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      dismissWaittingDialog();
      if (paramArrayList == null)
      {
        if (paramInt == 1)
          Toast.makeText(this, 2131034215, 1).show();
        if (paramInt == 2)
          Toast.makeText(this, 2131034216, 1).show();
        if (paramInt != 3)
          continue;
        Toast.makeText(this, 2131034217, 1).show();
      }
      updateListview(paramArrayList);
    }
  }

  public void notifyWait_DowningWordBase(Integer paramInteger)
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if (this.progressDialog_ImportWordbase == null)
        continue;
      this.progressDialog_ImportWordbase.setMessage(getString(2131034214) + "\n" + getString(2131034140) + ": " + paramInteger + "%");
    }
  }

  public void notifyWait_IOException()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if (this.progressDialog_ImportWordbase != null)
        this.progressDialog_ImportWordbase.dismiss();
      Toast.makeText(this, 2131034143, 1);
    }
  }

  public void notifyWait_Importing(Integer paramInteger1, Integer paramInteger2)
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if (this.progressDialog_ImportWordbase == null)
        continue;
      this.progressDialog_ImportWordbase.setMessage(getString(2131034211) + "\n" + getString(2131034212) + ": " + paramInteger1 + "\n" + getString(2131034140) + ": " + paramInteger2 + "%");
    }
  }

  public void notifyWait_Unzipping()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if (this.progressDialog_ImportWordbase == null)
        continue;
      this.progressDialog_ImportWordbase.setMessage(getString(2131034213));
    }
  }

  public void notifyWaitingLoadData()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      showWaittingDialog();
    }
  }

  public void notifyWorkComplete_DownWordBase()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if (this.progressDialog_ImportWordbase != null)
        this.progressDialog_ImportWordbase.dismiss();
      Toast.makeText(this, 2131034209, 1).show();
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.proccessor = new Proccessor_OnlineImportWordBase(this);
    setTitle(getString(2131034112) + "-->" + getString(2131034204));
    initFrame();
    this.proccessor.asyncLoadData();
  }

  protected void onDestroy()
  {
    this.proccessor.destroy();
    super.onDestroy();
  }

  protected void onPause()
  {
    super.onPause();
    MobclickAgent.onPause(this);
  }

  protected void onResume()
  {
    super.onResume();
    MobclickAgent.onResume(this);
    App.getApp().getActivitysHolder().regCurrentActivity(this);
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.uis.wordbases.onlineImport.OnlineImportWordBaseActivity
 * JD-Core Version:    0.5.3
 */